package step4;
import java.util.Scanner;
public class MainClass {
 public static void main(String[] args) {
     Scanner scanner = new Scanner(System.in);
     StudentDAOImpl studentDAOImpl = new StudentDAOImpl();
     //1. 插入学生信息
     Student stu = new Student();
     stu.setSno(scanner.next());
     stu.setSname(scanner.next());
     stu.setSdept(scanner.next());
     studentDAOImpl.insertStudent(stu);
     //2. 显示插入学生信息
     System.out.println("1. 插入学生信息如下：");
     studentDAOImpl.displayAllStudent();
     //3. 更新学生信息
     stu.setSname("李四");
     stu.setSdept("计算机系");
     studentDAOImpl.updateStudent(stu);
     System.out.println("2. 更新后学生信息如下：");
     System.out.println(studentDAOImpl.findStudentBySno(stu.getSno()));
     //4. 删除指定学生信息
     System.out.println("3. 删除当前学号学生信息：" + stu.getSno());
     studentDAOImpl.deleteStudent(stu.getSno());
     System.out.println("学生信息已删除!");
     //2. 显示插入学生信息
     System.out.println("5. 显示所有学生信息：");
     studentDAOImpl.displayAllStudent();
     scanner.close();
 }
}